﻿#region itdc

/************************************************************************
*Copyright(C) 2015 by qsgy
 *All rights reserved. 
 *FileName:     $safeitemname$
 *Author:       oyh
 *Version:      
 *UnityVersion：
 *Date:   $time$      
 *Description:    
 *History: 
************************************************************************/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// 追逐玩家状态
/// </summary>
public class ChasePlayer : FSMState {
    [SerializeField,Tooltip("怪物")]
    private Mover mover;
    [SerializeField, Tooltip("追踪智能")]
    private ChaseType ai = ChaseType.Stupid;
    private Transform playerTrans;//玩家trans
    public ChasePlayer()
    {
        id = StateID.ChasePlayer;

    }

    private void Awake()
    {
        mover = GetComponent<Mover>();
#if DEBUG
        if (mover == null)
        {
            Debug.LogError("巡逻状态没有找到移动脚本");

        }
#endif
    }
    private void Start()
    {
        playerTrans = GameManager.Instance.Player.transform;
    }

    public override void CheckFresh()
    {
        //print(playerTrans.position);
        if (playerTrans == null) return;

        switch (ai)
        {
            case ChaseType.Smart:
                print("未完成");
                break;
            case ChaseType.Normal:
                print("未完成");
                break;
            case ChaseType.Stupid:
                
                mover.tagertPos=playerTrans.position;
                
                break;
            default:
                break;
        }
    }

    /// <summary>
    /// 追逐智能
    /// smart会躲避玩家技能会寻路，Normal会寻路,stupid盯着玩家走
    /// </summary>
    public enum ChaseType
    {
        Smart,Normal,Stupid
    }
}
